<template>
  <div>
    <Modal title="标书盖章" v-model="sealModal" @on-ok="comfirmSealMan" @on-cancel="sealCancel">
      <Select v-model="sealMan" style="width:200px" :label-in-value="true">
        <Option v-for="item in sealList" :value="item.id" :key="item.id">{{ item.name }}</Option>
      </Select>
      <!-- <Input placeholder="请填写盖章人" v-model="sealMan"/> -->
    </Modal>
    <Modal title="项目盖章" v-model="proModal" @on-ok="comfirmproMan" @on-cancel="proCancel">
      <Select v-model="proMan" style="width:200px" :label-in-value="true">
        <Option v-for="item in sealList" :value="item.id" :key="item.id">{{ item.name }}</Option>
      </Select>
      <!-- <Input placeholder="请填写盖章人" v-model="proMan"/> -->
    </Modal>
    <Modal title="添加备注" v-model="remarkModal" @on-ok="comfirmRemark" @on-cancel="remarkCancel">
      <Input placeholder="请填写备注" v-model="remark" />
    </Modal>

    <div class="swith-btn">
      <Button type="success" @click="exportList" :disabled="exportBton">导出清单</Button>
    </div>
    <div class="search-bar">
      <div class="search-block">
        <span>承接部门:</span>
        <SelectTree
          :props="props"
          :options="dataTree"
          :value="valueId"
          :accordion="isAccordion"
          @getValue="getValue($event)"
        />
      </div>
      <div class="search-block">
        <span>承接人员:</span>
        <Select
          ref="myperson"
          v-model="model1"
          style="width:200px"
          @on-change="getperId($event)"
          :label-in-value="true"
          :disabled="easySearchBton"
        >
          <Option v-for="item in personName" :value="item.id" :key="item.id">{{ item.name }}</Option>
        </Select>
      </div>
      <div class="search-block">
        <span>年份:</span>
        <Select
          v-model="model2"
          :disabled="easySearchBton"
          @on-change="getyear($event)"
          :label-in-value="true"
        >
          <Option v-for="item in yearName" :value="item.id" :key="item.id">{{ item.name }}</Option>
        </Select>
      </div>
      <Button type="primary" @click="searchDeal" :disabled="easySearchBton">搜索</Button>
      <div class="senior-search-block">
        <Button v-if="clearHigh" type="warning" @click="HighClear">清除高级条件</Button>
        <Poptip trigger="focus" content="包含高级查询内容">
          <Input class="search-content" v-model="keyword" :disabled="highWinButton" />
        </Poptip>
        <Button type="default" @click="OpenhihgLevelSearch" :disabled="highWinButton">高级查询</Button>

        <Button type="primary" style @click="hihgLevelSearch" :disabled="highSearchBton">搜索</Button>
      </div>
    </div>

    <Tabs @on-click="getTabId">
      <TabPane label="项目盖章" icon="ios-browsers">
        <div>
          <Table
            height="500"
            border
            :columns="columns"
            :data="data"
            @on-selection-change="selectChange"
          ></Table>
        </div>
        <br />
        <div>
          <Page :total="totalDataNo" @on-change="getpageNum" />
        </div>
      </TabPane>
      <TabPane label="标书盖章" icon="ios-browsers-outline">
        <div>
          <Table height="500" border :columns="columns1" :data="data1"></Table>
        </div>
        <br />
        <div>
          <Page :total="totalData1No" @on-change="getpageNum1" />
        </div>
      </TabPane>
    </Tabs>

    <transition name="bidding-detail">
      <div class="bidding-block" v-if="sealDtail">
        <div class="bidding-block-top">
          <div class="bidding-block-close" @click="closesealdtail">
            <!--左上角关闭动作-->
            <Icon type="md-close" />
          </div>
          <span>项目详情</span>
        </div>
        <div class="undertake-title">
          <button class="undertake-title" @click.prevent="which='easynews'">项目基本信息</button>
          <button class="undertake-title" @click.prevent="which='authorizenews'">编制信息</button>
          <button class="undertake-title" @click.prevent="which='finacenews'">财务信息</button>
          <button class="undertake-title" @click.prevent="which='projectprogress'">项目进展</button>
        </div>
        <keep-alive>
          <component v-bind:is="which" :callbackdata="callbackdata" :callbackState="callbackState"></component>
        </keep-alive>
        <div>
          <Button type="primary" @click="closesealdtail">确定</Button>
        </div>
      </div>
    </transition>

    <transition name="bidding-detail">
      <div class="bidding-block" v-if="sealHigh">
        <Form ref="formHigh" :rules="ruleHigh" :model="equalConditions" :label-width="150">
          <div class="bidding-block-top">
            <div class="bidding-block-close" @click="cancelAdd">
              <!--左上角关闭动作-->
              <Icon type="md-close" />
            </div>
            <span>高级查询</span>
          </div>
          <div>
            <div class="bidding-body">
              <div class="bidding-content">
                <div>
                  <div class="bidding-item">
                    <FormItem label="审批日期范围从：">
                      <DatePicker type="date" v-model="rangeConditions[0].sta" />
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem :label-width="50">
                      <span>至</span>
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem :label-width="50">
                      <DatePicker type="date" v-model="rangeConditions[0].end" />
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem label="建设单位：" prop="developmentOrganization">
                      <Input
                        class="bidding-item-input"
                        v-model="equalConditions.developmentOrganization"
                      />
                    </FormItem>
                  </div>
                </div>

                <div>
                  <div class="bidding-item">
                    <FormItem label="登记日期范围从：">
                      <DatePicker type="date" v-model="rangeConditions[1].sta" />
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem :label-width="50">
                      <span>至</span>
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem :label-width="50">
                      <DatePicker type="date" v-model="rangeConditions[1].end" />
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem label="项目类别：">
                      <Select
                        v-model="equalConditions.type"
                        clearable
                        style="width:200px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in proType"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>
                </div>

                <div>
                  <div class="bidding-item">
                    <FormItem label="项目名称：" prop="name">
                      <Input
                        style="width:187px"
                        class="bidding-item-input"
                        v-model="equalConditions.name"
                      />
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem label="任务单编号：" :label-width="115" prop="taskNumber">
                      <Input
                        style="width:187px"
                        class="bidding-item-input"
                        v-model="equalConditions.taskNumber"
                      />
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem label="审定状态：">
                      <Select
                        v-model="equalConditions.hasAudited"
                        clearable
                        style="width:200px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in auditOption"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>
                </div>

                <div>
                  <div class="bidding-item">
                    <FormItem label="合同有无：">
                      <Select
                        v-model="equalConditions.hasContract"
                        clearable
                        style="width:187px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in ifContactOption"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem label="承接人：" :label-width="115">
                      <Select
                        v-model="equalConditions.undertakePersonId"
                        clearable
                        style="width:187px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in allPeo"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>
                  <div class="bidding-item">
                    <FormItem label="编制人员：">
                      <Select
                        v-model="equalConditions.editPersonId"
                        clearable
                        style="width:200px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in editPerList"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>
                </div>

                <div>
                  <div class="bidding-item">
                    <FormItem label="盖章经办人：">
                      <Select
                        v-model="equalConditions.usualSealerId"
                        clearable
                        style="width:187px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in sealList"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>

                  <div class="bidding-item">
                    <FormItem label="归档状态：" :label-width="115">
                      <Select
                        v-model="equalConditions.hasArchived"
                        clearable
                        style="width:187px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in backFileOption"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>

                  <div class="bidding-item">
                    <FormItem label="盖章状态：">
                      <Select
                        v-model="equalConditions.hasUsualSealed"
                        clearable
                        style="width:200px"
                        :label-in-value="true"
                      >
                        <Option
                          v-for="item in sealOption"
                          :value="item.id"
                          :key="item.id"
                        >{{ item.name }}</Option>
                      </Select>
                    </FormItem>
                  </div>
                </div>

                <div>
                  <Button type="primary" @click="checkAdd('formHigh')">确定</Button>
                  <Button @click="cancelAdd">取消</Button>
                </div>
              </div>
            </div>
          </div>
        </Form>
      </div>
    </transition>
  </div>
</template>

<script>
import axios from "axios";
import SelectTree from "../../components/treeSelect.vue";
export default {
  components: {
    SelectTree
  },
  data() {
    //不含空格 非必填
    const validateSpace = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeSpachs(value);
        if (res === -1) {
          callback(new Error("不能含有空格"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //数字+汉字+字母  非必填
    const validateLenNoCHLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNumberInput(value);
        if (res === -1) {
          callback(new Error("输入只能是汉字、英文或数字符号"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    return {
      row: {},
      pageNum: 1,
      pageSize: 10,
      modelId: 5,

      pageNum1: 1,

      totalDataNo: null, //总共的数据个数

      //处理权限disabled
      exportBton: true,
      easySearchBton: true,
      highWinButton: true,
      highSearchBton: true,
      jurisdiction: null, //当前用户的权限
      jurisdictionNo: null, //1标识只有承接，2表示只有管理，3表示都有

      ruleHigh: {
        developmentOrganization: [
          //建设单位 数+英+汉
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        name: [
          //项目名称
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        taskNumber: [
          { required: false, validator: validateSpace, trigger: "blur" }
        ]
      },
      //树型select********************************
      isClearable: true, // 可清空
      isAccordion: true, // 可收起
      valueId: 0, // 查询部门ID
      valueId2: 0,
      props: {
        // 配置项（必选）
        value: "id",
        label: "name",
        children: "children"
        // disabled:true
      },
      //第一个界面的查询*****************
      personName: [{ id: 0, name: "全部" }], //承接人员数组
      model1: 0, //承接人员ID
      dataTree: [], //部门树
      perNo: 0, //在拿人员的时候定义的一共的页数
      yearName: [], //年份数组
      model2: 0, //年份ID
      nowyear: {}, //当前年

      select1: null,
      select2: null,
      select3: null,

      which: "easynews",
      callbackdata: {}, //返回数据
      sealDtail: false,

      selected: true, //标记是项目盖章还是标书盖章
      sealModal: false, //标书盖章Modal
      proModal: false,
      sealMan: null, //盖章人
      proMan: null,
      remarkModal: false, //备注Modal
      remark: "",
      data1: [],
      keyword: null,

      columns1: [
        {
          type: "selection",
          width: 60,
          align: "center",
          fixed: "left"
        },
        {
          title: "序号",
          width: 100,
          key: "id",
          fixed: "left"
        },
        {
          title: "状态",
          width: 120,
          key: "state"
        },
        // {
        //   title: "盖章状态",
        //   width: 85,
        //   key: "ifedit",
        //   fixed: "right",
        //   render: (h, params) => {
        //     let st = params.row.state;
        //     if (st >= 3) {
        //       if (st < 128) {
        //         return h("Dropdown", [
        //           h("Button", { props: { type: "error" } }, "标")
        //         ]);
        //       }
        //     }
        //   }
        // },
        {
          title: "操作",
          fixed: "right",
          key: "number",
          width: 120,
          render: (h, params) => {
            let st = params.row.state;
            let detailBton = true;
            let sealBton = true;
            let addBton = true;
            let tab = {};
            let flag = 0;
            if (this.jurisdictionNo >= 1) {
              detailBton = false;
            }
            if (st <= 1) {
              tab = "标书盖章";
              flag = 1;
              if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
                sealBton = false;
              }
            } else {
              tab = "撤销标书盖章";
              flag = 2;
              if (this.jurisdictionNo == 2 || this.jurisdictionNo == 3) {
                sealBton = false;
              }
            }
            if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
              addBton = false;
            }
            if (st >= 3 && st < 128) {
              return h("Badge", { props: { text: "标", offset: [13, 0] } }, [
                h(
                  "Dropdown",
                  {
                    on: {
                      "on-click": name => {
                        let rowData = params.row;
                        let id = rowData.id;
                        if (name == "read") {
                          //点击查看详情
                          this.sealDtail = true;
                          this.row = id;
                          this.setBackdata();
                        } else if (name == "seal") {
                          //点击盖章
                          this.row = id;
                          ////console.log(this.row);
                          this.judgeTab1(flag);
                        } else if (name == "remark") {
                          //点击添加备注
                          this.row = id;
                          this.remarkModal = true;
                        }
                      }
                    },
                    props: {
                      transfer: true
                    }
                  },
                  [
                    h(
                      "Button",
                      {
                        props: {
                          type: "primary"
                        }
                      },
                      "操作>>"
                    ),
                    h(
                      "DropdownMenu",
                      {
                        slot: "list"
                      },
                      [
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "read",
                              disabled: detailBton
                            }
                          },
                          "查看详情"
                        ),
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "seal",
                              disabled: sealBton
                            }
                          },
                          tab
                        ),
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "remark",
                              disabled: addBton
                            }
                          },
                          "添加备注"
                        )
                      ]
                    )
                  ]
                )
              ]);
            } else {
              return h(
                "Dropdown",
                {
                  on: {
                    "on-click": name => {
                      let rowData = params.row;
                      let id = rowData.id;
                      if (name == "read") {
                        //点击查看详情
                        this.sealDtail = true;
                        this.row = id;
                        this.setBackdata();
                      } else if (name == "seal") {
                        //点击盖章
                        this.row = id;
                        ////console.log(this.row);
                        this.judgeTab1(flag);
                      } else if (name == "remark") {
                        //点击添加备注
                        this.row = id;
                        this.remarkModal = true;
                      }
                    }
                  },
                  props: {
                    transfer: true
                  }
                },
                [
                  h(
                    "Button",
                    {
                      props: {
                        type: "primary"
                      }
                    },
                    "操作>>"
                  ),
                  h(
                    "DropdownMenu",
                    {
                      slot: "list"
                    },
                    [
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "read",
                            disabled: detailBton
                          }
                        },
                        "查看详情"
                      ),
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "seal",
                            disabled: sealBton
                          }
                        },
                        tab
                      ),
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "remark",
                            disabled: addBton
                          }
                        },
                        "添加备注"
                      )
                    ]
                  )
                ]
              );
            }
          }
        }
      ],

      columns: [
        {
          type: "selection",
          width: 60,
          align: "center",
          fixed: "left"
        },
        {
          title: "序号",
          width: 100,
          key: "id",
          fixed: "left"
        },
        {
          title: "状态",
          width: 120,
          key: "state"
        },
        // {
        //   title: "盖章状态",
        //   width: 85,
        //   key: "ifedit",
        //   fixed: "right",
        //   render: (h, params) => {
        //     let st = params.row.state;
        //     let times = params.row.sealTime;
        //     if (st >= 63) {
        //       if (st < 128) {
        //         return h("Dropdown", [
        //           h(
        //             "Button",
        //             { props: { type: "error", shape: "circle" } },
        //             "盖"
        //           )
        //         ]);
        //       }
        //     }
        //   }
        // },
        {
          title: "操作",
          fixed: "right",
          key: "number",
          width: 120,
          render: (h, params) => {
            let st = params.row.state;
            let detaBton = true;
            let addButton = true;
            let flag = true;
            let flag1 = true;
            if (this.jurisdictionNo >= 1) {
              detaBton = false;
            }
            if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
              addButton = false;
            }
            if (st <= 31) {
              if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
                flag = true;
                flag1 = false;
              }
            } else {
              if (this.jurisdictionNo == 2 || this.jurisdictionNo == 3) {
                flag = false;
                flag1 = true;
              }
            }
            if (st >= 63 && st < 128) {
              return h("Badge", { props: { text: "盖", offset: [13, 0] } }, [
                h(
                  "Dropdown",
                  {
                    on: {
                      "on-click": name => {
                        let rowData = params.row;
                        let id = rowData.id;
                        let st = params.row.state;
                        if (name == "read") {
                          //点击查看详情
                          this.sealDtail = true;
                          this.row = id;
                          this.setBackdata(st);
                        } else if (name == "seal") {
                          //点击盖章
                          this.row = id;
                          this.judgeTab(1);
                        } else if (name == "cancelseal") {
                          this.row = id;
                          this.judgeTab(2);
                        } else if (name == "remark") {
                          //点击添加备注
                          this.row = id;
                          this.remarkModal = true;
                        }
                      }
                    },
                    props: {
                      transfer: true
                    }
                  },
                  [
                    h(
                      "Button",
                      {
                        props: {
                          type: "primary"
                        }
                      },
                      "操作>>"
                    ),
                    h(
                      "DropdownMenu",
                      {
                        slot: "list"
                      },
                      [
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "read"
                            }
                          },
                          "查看详情"
                        ),
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "seal",
                              disabled: flag1
                            }
                          },
                          "项目盖章"
                        ),
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "cancelseal",
                              disabled: flag
                            }
                          },
                          "撤销项目盖章"
                        ),
                        h(
                          "DropdownItem",
                          {
                            props: {
                              name: "remark"
                            }
                          },
                          "添加备注"
                        )
                      ]
                    )
                  ]
                )
              ]);
            } else {
              return h(
                "Dropdown",
                {
                  on: {
                    "on-click": name => {
                      let rowData = params.row;
                      let id = rowData.id;
                      let st = params.row.state;
                      if (name == "read") {
                        //点击查看详情
                        this.sealDtail = true;
                        this.row = id;
                        this.setBackdata(st);
                      } else if (name == "seal") {
                        //点击盖章
                        this.row = id;
                        this.judgeTab(1);
                      } else if (name == "cancelseal") {
                        this.row = id;
                        this.judgeTab(2);
                      } else if (name == "remark") {
                        //点击添加备注
                        this.row = id;
                        this.remarkModal = true;
                      }
                    }
                  },
                  props: {
                    transfer: true
                  }
                },
                [
                  h(
                    "Button",
                    {
                      props: {
                        type: "primary"
                      }
                    },
                    "操作>>"
                  ),
                  h(
                    "DropdownMenu",
                    {
                      slot: "list"
                    },
                    [
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "read"
                          }
                        },
                        "查看详情"
                      ),
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "seal",
                            disabled: flag1
                          }
                        },
                        "项目盖章"
                      ),
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "cancelseal",
                            disabled: flag
                          }
                        },
                        "撤销项目盖章"
                      ),
                      h(
                        "DropdownItem",
                        {
                          props: {
                            name: "remark"
                          }
                        },
                        "添加备注"
                      )
                    ]
                  )
                ]
              );
            }
          }
        }
      ],
      callbackState: {},
      selectId: [], //选中的项目数组
      ids: [], //要传的id数组
      data: [],
      tabID: 0,
      totalData1No: null,
      sealList: [], //具有盖章权限的人
      proType: [], //项目类别名单
      editPerList: [], //编制权限人名单
      allPeo: [], //所有人的名单
      allPeoPages: null,
      //////////////////////////////////////
      sealHigh: false,
      clearHigh: false,

      equalConditions: {
        //单个字段list
        developmentOrganization: null, //建设单位
        name: null, //项目名称
        type: null, //项目类别
        hasUsualSealed: null, //盖章状态
        taskNumber: null, //任务单编号
        hasAudited: null, //审定状态---
        hasContract: null, //合同有无
        undertakePersonId: null, //承接人id---
        editPersonId: null, //编制人id
        usualSealerId: null, //盖章人id---
        hasArchived: null //归档状态

        //共11个
      },
      rangeConditions: [
        //传给后端的时间，或金额字段
        {
          field: "contractDate",
          sta: null,
          end: null
        },
        {
          field: "collectionDate",
          sta: null,
          end: null
        }
      ],
      specialConditions: [], //传给后端的特殊字段

      contactOrgOption: [
        //合同归属
        {
          id: "学校",
          name: "学校"
        },
        {
          id: "公司",
          name: "公司"
        }
      ],
      collecOption: [
        //收款状态
        {
          id: "collectionAmount=0",
          name: "尚无收款"
        },
        {
          id: "collectionAmount=fund",
          name: "已收款"
        },
        {
          id: "collectionAmount>0 and collectionAmount<fund",
          name: "部分收款"
        },
        {
          id: "collectionAmount=0 or collectionAmount<fund",
          name: "尚无收款及部分收款"
        },
        {
          id: "collectionAmount>0",
          name: "已收款及部分收款"
        }
      ],
      sealOption: [
        //盖章状态
        {
          id: 0,
          name: "未盖章"
        },
        {
          id: 1,
          name: "已盖章"
        }
      ],
      invoiceOption: [
        //发票状态
        {
          id: "invoiceAmount=0",
          name: "发票未开"
        },

        {
          id: "invoiceAmount>0 and invoiceAmount<fund",
          name: "发票部分开"
        },
        {
          id: "invoiceAmount>0 and invoiceAmount<=fund",
          name: "发票已开+部分开"
        },
        {
          id: "invoiceAmount=0 or (invoiceAmount > 0 and invoiceAmount<fund)",
          name: "发票未开+部分开"
        },
        {
          id: "invoiceAmount=fund and invoiceAmount!=0",
          name: "发票已开"
        }
      ],
      rewardOption: [
        //奖金状态
        {
          id: "rewardAmount=0",
          name: "尚无奖金"
        },
        {
          id: "rewardAmount=collectionAmount and rewardAmount!=0",
          name: "奖金等于收款"
        },
        {
          id: "rewardAmount>collectionAmount",
          name: "奖金多于收款"
        },
        {
          id: "rewardAmount<collectionAmount",
          name: "奖金少于收款"
        },
        {
          id: "rewardAmount<collectionAmount or rewardAmount=0",
          name: "尚无奖金且奖金少于收款"
        }
      ],
      ifContactOption: [
        //合同有无
        {
          id: 0,
          name: "无合同"
        },
        {
          id: 1,
          name: "有合同"
        }
      ],
      outputOption: [
        //业务开支
        {
          id: 0,
          name: "无"
        },
        {
          id: 1,
          name: "有"
        },
        {
          id: 2,
          name: "未处理"
        }
      ],
      contactStateOption: [
        //项目状态
        {
          id: 1,
          name: "正常"
        },
        {
          id: 0,
          name: "废弃"
        }
      ],
      backFileOption: [
        //归档状态
        {
          id: 1,
          name: "已归档"
        },
        {
          id: 0,
          name: "未归档"
        }
      ],
      auditOption: [
        {
          id: 1,
          name: "已审定"
        },
        {
          id: 0,
          name: "未审定"
        }
      ]
    };
  },
  beforeMount() {
    this.getNewData(); //产生表信息
    this.getcolumns(); //产生表头
    this.getdepartments(); //得到部门的name和ID
    this.getNowYear();
    this.getNewData1();
    this.getcolumns1();
    this.getSealpeo();
    this.getproType(); //项目类别
    this.getEditpersonList(); //编制人员
    this.getAllPeo(); //得到所有人
    this.getJurisdiction(); //获得当前用户的权限
    ////console.log(this.valueId);
    ////console.log(this.model1);
    ////console.log(this.model2);
    ////console.log(this.totalDataNo);
  },
  methods: {
    getJurisdiction() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getPermission"
      }).then(result => {
        this.jurisdiction = result.data.data;
        // console.log("权限", this.jurisdiction);
        var i = 0;
        var judge1 = 0;
        var judge2 = 0;
        for (i; i < this.jurisdiction.length; i++) {
          if (this.jurisdiction[i] == "盖章") {
            judge1 = 1;
          }
          if (this.jurisdiction[i] == "管理") {
            judge2 = 1;
          }
        }
        if (judge1 == 1 && judge2 == 1) {
          this.jurisdictionNo = 3;
        } else if (judge1 != 1 && judge2 == 1) {
          this.jurisdictionNo = 2;
        } else if (judge1 == 1 && judge2 != 1) {
          this.jurisdictionNo = 1;
        } else {
          this.jurisdictionNo = -1;
        }
        // console.log("数字权限", this.jurisdictionNo);
        this.handleJurisdiction();
      });
    },
    //处理操作的disabled
    handleJurisdiction() {
      if (this.jurisdictionNo >= 1) {
        this.exportBton = false;
        this.easySearchBton = false;
        this.highWinButton = false;
        this.highSearchBton = false;
      } else {
        this.exportBton = true;
        this.easySearchBton = true;
        this.highWinButton = true;
        this.highSearchBton = true;
      }
    },
    selectChange: function(data) {
      this.selectId = data;
      // ////console.log("select");
      // ////console.log(data);
    },
    exportList() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      ////console.log("select");
      ////console.log(this.selectId);
      if (this.selectId.length > 0) {
        //选择了select
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        ////console.log(this.ids);
        this.realExport();
      } else {
        if (this.clearHigh) {
          //高级查询有条件
          this.$ajax({
            method: "post",
            url: this.IP.IP + "/table/superSearchIds",
            data: {
              equalConditions: this.equalConditions,
              rangeConditions: this.rangeConditions,
              specialConditions: this.specialConditions
            }
          }).then(result => {
            // console.info("2");
            ////console.log(result.data.data);
            this.ids = result.data.data;
            this.realExport();
          });
        } else {
          //两个都没有，设定全部导出
          this.$ajax({
            method: "post",
            url: this.IP.IP + "/table/superSearchIds"
          }).then(result => {
            // console.info("3");
            ////console.log(result.data.data);
            this.ids = result.data.data;
            this.realExport();
          });
        }
      }
    },

    realExport() {
      var u = this.IP.IP + "/usualSeal/exportList?ids=";
      for (var i = 0; i < this.ids.length - 1; i++) {
        u = u + this.ids[i] + ",";
      }
      u = u + this.ids[this.ids.length - 1];
      axios({
        method: "get",
        url: u,

        responseType: "blob"
      }).then(result => {
        // console.info("zong");
        ////console.log(result);
        this.downloadFile(result);
        this.$Spin.hide();
      });
      this.ids = [];
      this.selectId = [];
    },
    downloadFile(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "项目盖章导出清单.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    backProSeal() {
      axios({
        method: "get",
        url: this.IP.IP + "/usualSeal/undoUsualSeal?projectId=" + this.row
      }).then(result => {
        // console.info("确定新建");
        ////console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("撤销项目盖章成功");
          this.getNewDataByPage();
        } else {
          this.$Message.error(msg);
        }
      });
    },
    backBiaoSeal() {
      axios({
        method: "get",
        url: this.IP.IP + "/bidSeal/undoBidSeal?projectId=" + this.row
      }).then(result => {
        // console.info("确定新建");
        ////console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("撤销标书盖章成功");
          this.getNewData1ByPage();
        } else {
          this.$Message.error(msg);
        }
      });
    },
    judgeTab1(flag) {
      let f = flag;
      //console.info("flag");
      //////console.log(f);
      if (flag == 1) {
        this.sealModal = true;
      } else if (flag == 2) {
        this.backBiaoSeal();
      }
    },
    judgeTab(flag) {
      let f = flag;
      //console.info("flag");
      //////console.log(f);
      if (flag == 1) {
        this.proModal = true;
      } else if (flag == 2) {
        this.backProSeal();
      }
    },
    DateToString(date) {
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
        var newmonth = "0" + month;
        month = newmonth;
      }
      if (day < 10) {
        var newday = "0" + day;
        day = newday;
      }
      var sDate = year + "-" + month + "-" + day;
      return sDate;
    },
    setConditionNull() {
      var i = 0;
      if (!this.keyword) {
        this.keyword = null;
      }
      for (i = 0; i < this.rangeConditions.length; i++) {
        if (!this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = null;
        }
        if (!this.rangeConditions[i].end) {
          this.rangeConditions[i].end = null;
        }
      }
      for (i = 0; i < this.rangeConditions.length; i++) {
        if (this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = this.DateToString(
            this.rangeConditions[i].sta
          );
        }
        if (this.rangeConditions[i].end) {
          this.rangeConditions[i].end = this.DateToString(
            this.rangeConditions[i].end
          );
        }
      }
      if (!this.equalConditions.developmentOrganization) {
        //建设单位
        this.equalConditions.developmentOrganization = null;
      }

      if (!this.equalConditions.hasArchived) {
        //归档状态
        if (this.equalConditions.hasArchived != 0) {
          this.equalConditions.hasArchived = null;
        }
      }
      if (!this.equalConditions.editPersonId) {
        //编制人id
        this.equalConditions.editPersonId = null;
      }

      if (!this.equalConditions.name) {
        //项目名称
        this.equalConditions.name = null;
      }
      if (!this.equalConditions.taskNumber) {
        //任务单编号
        this.equalConditions.taskNumber = null;
      }

      if (!this.equalConditions.type) {
        //项目类别
        this.equalConditions.type = null;
      }

      if (!this.equalConditions.hasUsualSealed) {
        //盖章状态
        if (this.equalConditions.hasUsualSealed != 0) {
          this.equalConditions.hasUsualSealed = null;
        }
      }
      if (!this.equalConditions.hasContract) {
        //合同有无
        if (this.equalConditions.hasContract != 0) {
          this.equalConditions.hasContract = null;
        }
      }
      if (!this.equalConditions.hasAudited) {
        //审定状态
        if (this.equalConditions.hasAudited != 0) {
          this.equalConditions.hasAudited = null;
        }
      }
      if (!this.equalConditions.editPersonId) {
        //编制人id
        this.equalConditions.editPersonId = null;
      }
      if (!this.equalConditions.usualSealerId) {
        //盖章人
        this.equalConditions.usualSealerId = null;
      }
    },
    OpenhihgLevelSearch() {
      this.sealHigh = true;
    },
    hihgLevelSearch() {
      if (this.tabID == 0) {
        this.highSearch11();
      } else if (this.tabID == 1) {
        this.highSearch21();
      }
    },
    highSearch11() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
        this.checkAdd1();
      }
      this.pageNum = 1;
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 5
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          ////console.log(result);
          this.data = result.data.data.data.list;
          var total = result.data.data.data.total;
          this.totalDataNo = total;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    highSearch21() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
        this.checkAdd1();
      }
      this.pageNum1 = 1;
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum1,
          pageSize: 10,
          modelId: 9
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          ////console.log(result);
          this.data1 = result.data.data.data.list;
          var total = result.data.data.data.total;
          this.totalData1No = total;
        } else {
          this.data1 = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    highSearch12() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
      }
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 5
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          ////console.log(result);
          this.data = result.data.data.data.list;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    highSearch22() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
      }
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum1,
          pageSize: 10,
          modelId: 9
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          ////console.log(result);
          this.data1 = result.data.data.data.list;
          var total = result.data.data.data.total;
          this.totalData1No = total;
        } else {
          this.data1 = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    ClearCondition() {
      var i = 0;
      this.keyword = null;
      for (i = 0; i < this.rangeConditions.length; i++) {
        this.rangeConditions[i].sta = null;
        this.rangeConditions[i].end = null;
      }
      this.equalConditions.developmentOrganization = null;
      this.equalConditions.name = null;
      this.equalConditions.type = null;
      this.equalConditions.hasUsualSealed = null;
      this.equalConditions.taskNumber = null;
      this.equalConditions.hasAudited = null;
      this.equalConditions.hasContract = null;
      this.equalConditions.undertakePersonId = null;
      this.equalConditions.editPersonId = null;
      this.equalConditions.usualSealerId = null;
      this.equalConditions.hasArchived = null;

      this.specialConditions = [];
    },
    HighClear() {
      this.ClearCondition();
      this.clearHigh = false;
    },
    cancelAdd() {
      this.sealHigh = false;
    },
    checkAdd1() {
      //高级查询点确定

      this.setConditionNull(); //空字符串变null
      this.sealHigh = false;
      this.clearHigh = true;
    },
    checkAdd(name) {
      //高级查询点确定
      // console.info("equal");
      // console.log(this.equalConditions);
      this.$refs[name].validate(valid => {
        if (valid) {
          this.setConditionNull(); //空字符串变null
          this.sealHigh = false;
          this.clearHigh = true;
        } else {
          this.$Message.error("格式错误!");
        }
      });
    },
    insertPeo() {
      // console.info("insetr");
      ////console.log(this.allPeoPages);
      var i = 1;
      for (i = 1; i <= this.allPeoPages; i++) {
        axios({
          method: "get",
          url: this.IP.IP + "/personInfo/show?pageNum=" + i + "&pageSize=" + 10
        }).then(result => {
          var total = result.data.data.list.length;
          var list = result.data.data.list;
          // console.info("lentgh");
          // console.info(total);
          ////console.log(list);
          for (var j = 0; j < total; j++) {
            this.allPeo.push({
              id: list[j].id + "",
              name: list[j].name + ""
            });
            // console.info(i);
            // ////console.log(this.allPeo);
          }
        });
      }
      // console.info("所有人名单");
      ////console.log(this.allPeo);
    },
    getAllPeo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/show?pageNum=" + 1 + "&pageSize=" + 10
      }).then(result => {
        this.allPeoPages = result.data.data.pages;
        // console.info("pages111");
        ////console.log(this.allPeoPages);
        this.insertPeo();
      });
      //this.insertPeo();
    },
    getEditpersonList() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getEditPerson"
      }).then(result => {
        var total = result.data.data.length;
        var list = result.data.data;
        for (var i = 0; i < total; i++) {
          this.editPerList.push({
            id: list[i].personId + "",
            name: list[i].personName + ""
          });
        }
        // console.info("编制人名单");
        ////console.log(this.editPerList);
      });
    },
    getproType() {
      axios({
        method: "get",
        url: this.IP.IP + "/getProjectTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.total;
        var list = result.data.data.list;
        for (var i = 0; i < total; i++) {
          this.proType.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
        // console.info("项目类别");
        ////console.log(this.proType);
      });
    },
    getSealpeo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getSealPerson"
      }).then(result => {
        //////console.log(this.row);
        var total = result.data.data.length;
        var list = result.data.data;
        for (var i = 0; i < total; i++) {
          this.sealList.push({
            id: list[i].personId + "",
            name: list[i].personName + ""
          });
        }
        // console.info("盖章权限名单");
        ////console.log(this.sealList);
      });
    },
    searchDeal() {
      if (this.tabID == 0) {
        this.getNewData();
      } else if (this.tabID == 1) {
        this.getNewData1();
      }
    },
    getTabId(id) {
      // console.info("tab");
      ////console.log(id);
      this.tabID = id;
      this.valueId = 0;
      this.model1 = 0;
      this.model2 = 0;
    },
    getpageNum(e) {
      // console.info("当前页");
      ////console.log(e);
      this.pageNum = e;
      if (this.clearHigh) {
        this.highSearch12();
      } else {
        this.getNewDataByPage();
      }
    },
    getpageNum1(e) {
      // console.info("当前页");
      ////console.log(e);
      this.pageNum1 = e;
      if (this.HighClear) {
        this.highSearch22();
      } else {
        this.getNewData1ByPage();
      }
    },
    getdepartments() {
      axios({
        method: "get",
        url: this.IP.IP + "/getDepartments"
      }).then(result => {
        // console.info("部门信息");
        ////console.log(result);
        var data = result.data.data;
        this.dataTree = [];
        var i = 0;
        for (i = 0; i < data.length; i++) {
          this.setNode(data[i]);
        }
        this.dataTree = data;
        this.dataTree.unshift({ id: 0, name: "全部", children: [] });
        // console.info("部门树");
        ////console.log(this.dataTree);
        //console.info('')
        //////console.log(this.valueId);
      });
    },
    setNode(node) {
      if (node != null) {
        node.name = node.nodeDepartmentIndex.name;
        node.id = node.nodeDepartmentIndex.id;
        node.children = node.childrenDepartmentIndexes;
        var i = 0;
        for (i = 0; i < node.childrenDepartmentIndexes.length; i++) {
          this.setNode(node.childrenDepartmentIndexes[i]);
        }
      }
    },
    getpersonPage() {
      axios({
        method: "get",
        url:
          this.IP.IP +
          "/getDepartmentsConsistent?departmentId=" +
          this.valueId +
          "&pageNumber=1&pageSize=5"
      }).then(result => {
        //this.personName = result.data.data.list;
        if (result.data.code == 0) {
          this.perNo = result.data.data.pages;
          // console.info("页数");
          ////console.log(this.perNo);
          this.getperson();
        }
      });
    },
    getperson() {
      var i = 0;
      for (i = 1; i <= this.perNo; i++) {
        axios({
          method: "get",
          url:
            this.IP.IP +
            "/getDepartmentsConsistent?departmentId=" +
            this.valueId +
            "&pageNumber=" +
            i +
            "&pageSize=5"
        }).then(result => {
          var size = result.data.data.size;
          var list = result.data.data.list;
          this.personName = this.personName.concat(list);
        });
      }
      //this.personName.unshift({ id: 0, name: "全部" });
      // console.info("人员名单");
      ////console.log(this.personName);
    },
    getperId(e) {
      ////console.log(e);
      this.valueId2 = e.value;
      // console.info("选中人员ID");
      ////console.log(this.valueId2);
      // console.info("部门选择不是全部的MOdal1的值");
      ////console.log(this.model1);
    },
    getValue(value) {
      this.valueId = value;
      ////console.log(this.valueId);
      //this.personName = [];
      if (this.valueId != 0) {
        this.personName = [{ id: 0, name: "全部" }];
        this.getpersonPage();
      } else {
        this.model1 = 0;
        this.personName = [{ id: 0, name: "全部" }];
      }
    },
    getNowYear() {
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
        var newmonth = "0" + month;
        month = newmonth;
      }
      if (day < 10) {
        var newday = "0" + day;
        day = newday;
      }
      var sDate = year + "-" + month + "-" + day;
      this.nowyear = year;
      this.nowDate = sDate;
      // console.info("当前年");
      ////console.log(this.nowyear);
      ////console.log(this.nowDate);
      for (var i = 2005; i <= this.nowyear; i++) {
        this.yearName.push({ id: i, name: i + "" });
      }
      this.yearName.unshift({ id: 0, name: "全部" });
      // console.info("年份数组");
      ////console.log(this.yearName);
    },
    getyear(e) {
      ////console.log(this.model2);
    },
    //select获取选择的data全部信息

    getNewDataByPage() {
      //项目盖章界面点击页面的data更新
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      ////console.log(this.select1);
      ////console.log(this.select2);
      ////console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 5
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        //console.info('111');
        //////console.log(fields);
        // var total = response.data.data.data.total;
        // this.totalDataNo = total;
        // console.info("total");
        // ////console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getNewData1ByPage() {
      //标书盖章界面根据页面更新data
      this.data1 = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      ////console.log(this.select1);
      ////console.log(this.select2);
      ////console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: this.pageNum1,
          pageSize: 10,
          modelId: 9
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data1 = response.data.data.data.list;
        //console.info('111');
        //////console.log(fields);

        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getNewData() {
      //项目盖章界面简单查询更新界面，默认为第一页，更新totaldatano
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      ////console.log(this.select1);
      ////console.log(this.select2);
      ////console.log(this.select3);
      this.pageNum = 1;
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: 1,
          pageSize: 10,
          modelId: 5
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        //console.info('111');
        //////console.log(fields);
        var total = response.data.data.data.total;
        this.totalDataNo = total;
        // console.info("total");
        ////console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getNewData1() {
      //标书盖章界面简单查询更新data，更新totaltdatano，默认为第一页
      this.data1 = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select1234");
      ////console.log(this.select1);
      ////console.log(this.select2);
      ////console.log(this.select3);
      this.pageNum1 = 1;
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: 1,
          pageSize: 10,
          modelId: 9
        },
        data: {
          undertakePersonId: this.select2,
          undertakeDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data1 = response.data.data.data.list;
        //console.info('111');
        //////console.log(fields);
        var total = response.data.data.data.total;
        this.totalData1No = total;
        // console.info("total");
        ////console.log(this.totalData1No);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getcolumns1() {
      //得到标书盖章的表头
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          9
      }).then(result => {
        let that = this;

        var fields = result.data.data.fields;
        var attribute = result.data.data.attribute;
        //var list=result.data.data.data.list;
        var i = 0;
        ////console.log(result);
        for (i; i < fields.length; i++) {
          this.columns1.push({
            title: fields[i],
            width: 120,
            key: attribute[i]
          });
        }
        //this.data=list;
      });
    },

    getcolumns() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          this.modelId
      }).then(result => {
        let that = this;

        var fields = result.data.data.fields;
        var attribute = result.data.data.attribute;
        //var list=result.data.data.data.list;
        var i = 0;
        ////console.log(result);
        for (i; i < fields.length; i++) {
          this.columns.push({
            title: fields[i],
            width: 120,
            key: attribute[i]
          });
        }
        //this.data=list;
      });
    },
    getData1() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          9
      }).then(result => {
        let that = this;
        var list = result.data.data.data.list;
        //var i=0;
        ////console.log(result);
        var total = result.data.data.data.total;
        this.totalData1No = total;
        // console.info("data1total");
        ////console.log(this.totalData1No);

        this.data1 = list;
      });
    },
    setBackdata(st) {
      ////console.log(this.row);
      this.callbackdata = this.row;
      this.callbackState = st;
    },
    closesealdtail() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.sealDtail = false;
        }
      });
    },
    switchTable() {
      this.selected = !this.selected;
      ////console.log(this.selected);
    },
    comfirmproMan() {
      ////console.log(this.row);
      ////console.log(this.proMan);
      this.$ajax({
        method: "get",
        url: this.IP.IP + "/usualSeal/usualSeal",
        params: {
          projectId: this.row,
          sealerId: this.proMan
        }
      }).then(result => {
        // console.info("确定新建");
        ////console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("项目盖章成功");
          this.proMan = null;
          this.getNewDataByPage();
          //this.getNewData();
        } else {
          this.$Message.error(msg);
        }
        this.proModal = false;
      });
    },
    proCancel() {
      this.proMan = null;
      this.sealModal = false;
    },
    comfirmSealMan() {
      ////console.log(this.row);
      ////console.log(this.sealMan);
      this.$ajax({
        method: "get",
        url: this.IP.IP + "/bidSeal/bidSeal",
        params: {
          projectId: this.row,
          sealerId: this.sealMan
        }
      }).then(result => {
        // console.info("确定新建");
        ////console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("标书盖章成功");
          this.getNewData1ByPage();
          this.sealMan = null;
          //this.getNewData();
        } else {
          this.$Message.error(msg);
          this.sealMan = null;
        }
        this.sealModal = false;
      });
    },
    sealCancel() {
      this.sealMan = null;
      this.sealModal = false;
    },
    comfirmRemark1() {
      ////console.log(this.remark);
      this.$ajax({
        method: "get",
        url: this.IP.IP + "/bidSeal/remark",
        params: {
          projectId: this.row,
          remark: this.remark
        }
      }).then(result => {
        // console.info("确定新建");
        ////console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("添加备注成功");
          // this.getNewData1();
          this.remark = null;
          //this.getNewData();
        } else {
          this.$Message.error(msg);
          this.remark = null;
        }
        this.remarkModal = false;
      });
    },
    comfirmRemark() {
      if (this.tabID == 0) {
        ////console.log(this.remark);
        this.$ajax({
          method: "get",
          url: this.IP.IP + "/usualSeal/remark",
          params: {
            projectId: this.row,
            remark: this.remark
          }
        }).then(result => {
          // console.info("确定新建");
          ////console.log(result);
          var code = "";
          code = result.data.code;
          var msg = result.data.msg;
          if (code == 0) {
            this.$Message.success("添加备注成功");
            // this.getNewData1();
            this.remark = null;
            //this.getNewData();
          } else {
            this.$Message.error(msg);
            this.remark = null;
          }
          this.remarkModal = false;
        });
      } else if (this.tabID == 1) {
        this.comfirmRemark1();
      }
    },
    remarkCancel() {
      this.remark = "";
      this.remarkModal = false;
    }
  }
};
</script>

<style>
.swith-btn {
  padding: 5px;
}
.search-bar {
  width: 100%;
}
.search-block {
  padding: 5px;
  display: inline-block;
  width: 300px;
  height: 50px;
}
.search-block span {
  line-height: 50px;
}
.search-block .ivu-select {
  width: 150px;
}
.senior-search-block {
  height: 50px;
  padding: 5px;
}
.search-content {
  width: 200px;
}
</style>